#ifndef _NVS_HPP
#define _NVS_HPP

void nvsInit();

void nvsInit()
{
	pageInfoAdd("Init NVS...");
	esp_err_t err = nvs_flash_init();
	if(err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND){
		nvs_flash_erase();
		err = nvs_flash_init();
	}
	ESP_ERROR_CHECK(err);
	pageInfoAdd("NVS init done.");
}


#endif